package com.gzdh.device.system.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gzdh.device.comm.vo.Result;
import com.gzdh.device.system.service.SysRoleService;
import com.gzdh.device.system.vo.RoleVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/role/v1")
public class SysRoleController {


    @Autowired
    SysRoleService sysRoleService;

    @GetMapping("getRoleListByPage")
    public Result<Object> getRoleListByPage(@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                            @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
        Result<Object> result = new Result<>();
        IPage<RoleVO> sysRoleIPage = sysRoleService.getRoleListByPage(pageNo, pageSize);
        result.setResult(sysRoleIPage);
        return result;
    }

}
